package org.xtlgen;

import java.util.ArrayList;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * NodeList implementation used to store parameters
 */
public class ParamList implements NodeList {
  /**
   * Builds an empty params list.
   */
  public ParamList() {
    this.list = new ArrayList<Node>();
  }
  
  /**
   * Obtain the number of Nodes on this list.
   *
   * @return the number of Nodes on this list.
   */
  public int getLength() {
    return this.list.size();
  }
  
  /**
   * Get the indexth Node on this list.
   *
   * @param index the requested index.
   *
   * @return the requested node.
   */
  public Node item(int index) {
    return this.list.get(index);
  }
  
  /**
   * Add the given Node to this list.
   *
   * @param node the new Node.
   */
  public void add(Node node) {
    this.list.add(node);
  }

  /*
   * Fields
   */
  private ArrayList<Node> list;
}
  
